<?php
// +----------------------------------------------------------------------
// | sfadmin - Suifeng Administration
// +----------------------------------------------------------------------
// | Copyright (c) 2017-2020 http://suifeng.tech All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: suifeng <1787585212@qq.com>
// +----------------------------------------------------------------------

namespace suifeng\admin;

use suifeng\utils\HtmlUtil;

final class AdminHtml
{
    public static function render_button($text, $icon, $class, $options = array())
    {
        $icon_html = $icon ? HtmlUtil::render_tag('i', array('class' => $icon)) : null;

        $attributes['type'] = 'button';
        $attributes['class'] = $class;
        $attributes = array_merge($attributes, $options);
        return HtmlUtil::render_tag('button', $attributes, $icon_html . $text);
    }

    public function render_span($text, $class, $options = array())
    {
        $attributes['class'] = $class;
        $attributes = array_merge($attributes, $options);
        return HtmlUtil::render_tag('span', $attributes, $text);
    }
}
